package com.dog.modules.system.api.feign;

import com.dog.framework.feign.core.FeignRequestInterceptor;
import com.dog.modules.system.api.vo.SysUserVO;
import io.swagger.v3.oas.annotations.Operation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * @author liuxk
 * @date 2024/1/5 14:22
 *
 */
@FeignClient(contextId = "system-biz-service-user-api",
        name = "system-biz-service",
        path = "/sys/user",
        configuration = FeignRequestInterceptor.class)
public interface SysUserFeignClient {


    @GetMapping(value = "/find/username/{username}",headers ="from=inner")
    @Operation(summary = "通过用户名称查询用户信息")
    SysUserVO findByUsername(@PathVariable(value="username") String username) ;

    // 接口只允许内部调用
    @GetMapping(value = "/find/mobile/{mobile}",headers ="from=inner")
    @Operation(summary = "通过手机号码查询用户信息")
    SysUserVO findByMobile(@PathVariable(value="mobile") String mobile) ;



    @PostMapping("/save")
    @Operation(summary = "保存")
    boolean save(@RequestBody SysUserVO vo) ;


}
